﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Aribaccio;
using CommunityToolkit.Mvvm.ComponentModel;

namespace BDPAutodetect.Models
{
    /// <summary>
    /// 工位电机机电模块信息
    /// </summary>
    public partial class MStationMotor : ObservableModel
    {
        /// <summary>
        /// 电流
        /// </summary>
        [ObservableProperty]
        protected decimal current;
        /// <summary>
        /// 电压
        /// </summary>
        [ObservableProperty]
        protected decimal voltage;
        /// <summary>
        /// 功率
        /// </summary>
        [ObservableProperty]
        protected decimal power;

        /// <summary>
        /// 重置
        /// </summary>
        public void Reset()
        {
            this.Current = 0;
            this.Voltage = 0;
            this.Power = 0;
        }

        /// <summary>
        /// 深度克隆
        /// </summary>
        public MStationMotor CloneDeep()
        {
            return new MStationMotor()
            {
                Current = this.Current,
                Voltage = this.Voltage,
                Power = this.Power
            };
        }
    }
}
